package com.hliushi.hotel.constants;

import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;

/**
 * @author llhuang10
 * @date 2021/9/7 11:46
 */
public class HotelConstants {

    public static final String INDEX_NAME = "hotel";

    public static String MAPPING_TEMPLATE = "";

    static {
        try {
            /**
             * 通过配置文件, 把索引库JSON格式的结构解耦
             */
            InputStream is = Thread.currentThread()
                    .getContextClassLoader().getResourceAsStream("MAPPING_TEMPLATE.json");

            MAPPING_TEMPLATE = IOUtils.toString(is, Charset.defaultCharset());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
